package user;



import action.BaseAction;
import dao.Jdbcuserdao;
import dao.Userdao;
import entity.User;

public class LoginAction extends BaseAction {
	//input
	private User user;	
	
	public String execute()throws Exception 
	{		
		
		Userdao dao=new Jdbcuserdao();
		
		if(user.getPassword().equals(dao.login(user.getName()).getPassword()))
		{
			
			
			
			session.put("user", user);
			
			
			
			
			return "success";
		}
		else
		{
			return "fail";
		}
		
		
		
	}	
	
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	
}